package com.lq.ecoldchain.ui.mine.carInfo.carline

import com.lq.ecoldchain.base.CommonLoadingViewModel
import org.kodein.di.Kodein
import org.kodein.di.android.support.AndroidLifecycleScope
import org.kodein.di.generic.bind
import org.kodein.di.generic.instance
import org.kodein.di.generic.scoped
import org.kodein.di.generic.singleton

/*
*2018/12/28 0028  17:01
*function by lq
*/
val carlineKodeinModule = Kodein.Module("Car_Line_Kodein_Module"){
    bind<CarLineViewModel>() with scoped(AndroidLifecycleScope).singleton {
        CarLineViewModel()
    }

    bind<CarLineDelegate>() with scoped(AndroidLifecycleScope).singleton {
        CarLineDelegate(
                viewModel = instance(),
                loadingViewModel = CommonLoadingViewModel.instance(context)
        )
    }
}